
#include <iostream>
#include <cassert>

using namespace std;
// 变量同名和函数同名会进行覆盖，但他们确实都存在
class aa
{
  protected:
    int a, b;

  public:
    aa(int v) : a{v} {}
    aa() = default;
    virtual void pnt() { cout << a << "\n"; }
    void plus(int &c) { ++c; }
};

class bb : public aa
{
  public:
    int a , c;

  public:
    bb(int v) : a{v} {}
    bb() = default;
    void pnt() { cout << a << b << "\n"; }
    virtual ~bb(){};
};

class cc : public bb 
{
    int b;

};

int main()
{
    aa a;
    bb b(3);
    b.pnt();
    b.plus(b.a);
    b.pnt();

    cout << sizeof(aa) << "\n"
         << sizeof(bb) << "\n"
         << sizeof(cc) << "\n";
    return 0;
}